//
//  YPKStatisticsRequest.h
//  Yopark
//
//  Created by 王家骏 on 14/10/30.
//  Copyright (c) 2014年 developer. All rights reserved.
//




#import <Foundation/Foundation.h>

/**
 *  @Author
 *
 *  请求房源列表时选择租期类型
 */

typedef NS_ENUM(NSUInteger, YPKLeaseType) {
    YPKLeaseTypeDay = 1,    //日租
    YPKLeaseTypeYear = 2,  //月租
    YPKLeaseTypeMonth = 3
    
};

/**
 *  @Author
 *
 *  预约看房时选择租赁类型
 */
typedef NS_ENUM(NSUInteger, YPKRentType) {
    YPKRentTypeShort = 1,   //短租
    YPKRentTypeMiddle = 2,  //中租
    YPKRentTypeLong = 3,    //长租
    
};


/**
 *  @Author
 *
 *  用户的操作类型
 */
typedef NS_ENUM(NSUInteger, YPKUserActionType) {
    YPKUserActionTypeResetPassword = 2, //重设密码
    YPKUserActionTypeRegister = 3,      //注册
    YPKUserActionTypeLogin = 4,         //登录
    
};

typedef NS_ENUM(NSUInteger, YPKHouseListSort) {
    YPKHouseListSortDefault = 0,    //综合排序
    YPKHouseListSortPriceUp,        //价格由低到高
    YPKHouseListSortPriceDown,      //价格由高到低
    YPKHouseListSortSquareDown,     //面积由大到小
    YPKHouseListSortSquareUp        //面积由小到大
};


@interface YPKStatisticsRequest : NSObject


#pragma mark - GET/location/

/**
 *  @Author
 *
 *  获得热门城市列表
 *
 *  @param success  成功回调
 *  @param failure  失败回调
 */
+ (void)getHotCityListSuccess:(void (^)(id responseObject))success
                      failure:(void (^)(NSError *error))failure;
//
///**
// *  @Author
// *
// *  获得城市行政区列表
// *
// *  @param cityId  城市id
// *  @param success 成功回调
// *  @param failure 失败回调
// */
//+ (void)getDistrictListWithCityId:(NSString *)cityId
//                          success:(void (^)(id responseObject))success
//                          failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  获得城市商圈列表
 *
 *  @param cityId  城市id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getLandMarkListWithCityId:(NSString *)cityId
                          success:(void (^)(id responseObject))success
                          failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  跟据行政区ID获取小区列表接口
 *
 *  @param districtId 行政区id
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)getCommunityListWithDistrictId:(NSString *)districtId
                               success:(void (^)(id responseObject))success
                               failure:(void (^)(NSError *error))failure;
#pragma mark - GET/house/

/**
 *  @Author
 *
 *  根据搜索条件获得房源列表
 *
 *  @param cityId       城市id
 *  @param districtId   行政区id
 *  @param landmarkId   商圈id
 *  @param communityId  小区id
 *  @param houseType    房型（几室几厅）
 *  @param price        单价
 *  @param personNumber 可住人数
 *  @param houseListSort排序类型
 *  @param leaseType    租期类型
 *  @param startNumber  开始条数
 *  @param endNumber    结束条数
 *  @param success      成功回调
 *  @param error        失败回调
 */
+ (NSURLSessionDataTask *)getHouseListWithCityId:(NSString *)cityId
                                      districtId:(NSString *)districtId
                                      landmarkId:(NSString *)landmarkId
                                     communityId:(NSString *)communityId
                                       houseType:(NSString *)houseType
                                           price:(NSString *)price
                                    personNumber:(NSString *)personNumber
                                            mark:(NSString *)mark
                                   houseListSort:(YPKHouseListSort)houseListSort
                                       leaseType:(YPKLeaseType)leaseType
                                     startNumber:(NSString *)startNumber
                                       endNumber:(NSString *)endNumber
                                         success:(void (^)(id))success
                                         failure:(void (^)(NSError *))failure;

/**
 *  @Author
 *
 *  首页热门房源列表
 *
 *  @param leaseType   租期类型
 *  @param startNumber 开始条数
 *  @param endNumber   结束条数
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)getHotHouseListWithLeaseType:(YPKLeaseType)leaseType
                         startNumber:(NSString *)startNumber
                           endNumber:(NSString *)endNumber
                             success:(void (^)(id responseObject))success
                             failure:(void (^)(NSError *error))failure;


/**
 *  @Author
 *
 *  获取区域地标房源统计列表
 *
 *  @param cityId  城市id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getLandMarkHouseCountWithCityId:(NSString *)cityId
                               success:(void (^)(id responseObject))success
                               failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  获取区域地标房源统计列表
 *
 *  @param cityId  城市id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getMapLandMarkHouseCountWithCityId:(NSString *)cityId
                                   success:(void (^)(id responseObject))success
                                   failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  根据房源ID获取附近房源列表接口
 *
 *  @param houseId     房源id
 *  @param leaseType   租期类型
 *  @param startNumber 开始条数
 *  @param endNumber   结束条数
 *  @param success     成功回调
 *  @param error       失败回调
 */
+ (void)getNearHouseListWithHouseId:(NSString *)houseId
                          leaseType:(YPKLeaseType)leaseType
                      houseListSort:(YPKHouseListSort)houseListSort
                        startNumber:(NSString *)startNumber
                          endNumber:(NSString *)endNumber
                            success:(void (^)(id responseObject))success
                            failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  根据房源ID获得房源详情接口
 *
 *  @param houseId 房源id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getHouseDetailWithHouseId:(NSString *)houseId
                          success:(void (^)(id responseObject))success
                          failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  根据房源ID获取房源服务列表接口
 *
 *  @param houseId 房源id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getHouseServiceListWithHouseId:(NSString *)houseId
                               success:(void (^)(id responseObject))success
                               failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  根据房源ID获取评论列表接口
 *
 *  @param houseId     房源id
 *  @param startNumber 开始条数
 *  @param endNumber   结束条数
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)getHouseCommentListWithHouseId:(NSString *)houseId
                           startNumber:(NSString *)startNumber
                             endNumber:(NSString *)endNumber
                               success:(void (^)(id responseObject))success
                               failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  根据房源ID获取房源图片列表接口
 *
 *  @param houseId 房源id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getHouseImgListWithHouseId:(NSString *)houseId
                           success:(void (^)(id responseObject))success
                           failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  获取图片类型列表接口
 *
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getImgTypeListSuccess:(void (^)(id responseObject))success
                      failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  根据小区ID获取小区详情接口
 *
 *  @param communityId 小区id
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)getCommunityDetailWithCommunityId:(NSString *)communityId
                                  success:(void (^)(id responseObject))success
                                  failure:(void (^)(NSError *error))failure;

#pragma mark - GET/order/
/**
 *  @Author
 *
 *  我的订单列表接口
 *
 *  @param userId      用户ID
 *  @param startNumber 开始条数
 *  @param endNumber   结束条数
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)getOrderListWithUserId:(NSString *)userId
                   startNumber:(NSString *)startNumber
                     endNumber:(NSString *)endNumber
                       success:(void (^)(id responseObject))success
                       failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  我的约看清单接口
 *
 *  @param userId      用户ID
 *  @param startNumber
 *  @param endNumber
 *  @param success
 *  @param failure
 */
+ (void)getAppointMentListWithUserId:(NSString *)userId
                         startNumber:(NSString *)startNumber
                           endNumber:(NSString *)endNumber
                             success:(void (^)(id responseObject))success
                             failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  获取订单状态说明列表接口
 *
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getOrderStateListsuccess:(void (^)(id responseObject))success
                         failure:(void (^)(NSError *error))failure;
#pragma mark - POST/order/
/**
 *  @Author
 *
 *  预约看房提交接口
 *
 *  @param houseId   房源id
 *  @param rentType  租赁类型
 *  @param userName  租客姓名
 *  @param userPhone 租客电话
 *  @param date      看房日期
 *  @param success   成功回调
 *  @param failure   失败回调
 */
+ (void)postAppointmentWithHouseId:(NSString *)houseId
                          rentType:(int)rentType
                          userName:(NSString *)userName
                         userPhone:(NSString *)userPhone
                              date:(NSString *)date
                             token:(NSString *)token
                           success:(void (^)(id responseObject))success
                           failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  房源预订接口
 *
 *  @param userId       用户id
 *  @param houseId      房源id
 *  @param checkin      入住时间
 *  @param checkout     退房时间
 *  @param contactName  入住人姓名
 *  @param contactPhone 入住人电话
 *  @param contactEmail 入住人邮箱
 *  @param questNum     入住人数
 *  @param success      成功回调
 *  @param failure      失败回调
 */
+ (void)houseBookingWithUserId:(NSString *)userId
                       houseId:(NSString *)houseId
                       checkin:(NSString *)checkin
                      checkout:(NSString *)checkout
                   contactName:(NSString *)contactName
                  contactPhone:(NSString *)contactPhone
                  contactEmail:(NSString *)contactEmail
                      guestNum:(NSString *)guestNum
                         token:(NSString *)token
                       success:(void (^)(id responseObject))success
                       failure:(void (^)(NSError *error))failure;

#pragma mark - POST/user/
/**
 *  @Author
 *
 *  用户请求下发验证码接口
 *
 *  @param phoneNum   手机号码
 *  @param actionType 操作类型
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)sendCodeWithPhoneNum:(NSString *)phoneNum
                  actionType:(YPKUserActionType)actionType
                     success:(void (^)(id responseObject))success
                     failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  用户提交注册接口
 *
 *  @param phoneNum        手机号
 *  @param verficationCode 验证码
 *  @param email           邮箱
 *  @param password        密码
 */
+ (void)registerWithPhoneNum:(NSString *)phoneNum
             verficationCode:(NSString *)verficationCode
                       email:(NSString *)email
                    password:(NSString *)password
                     success:(void (^)(id responseObject))success
                     failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  用户登录接口
 *
 *  @param phoneNum        手机号
 *  @param verficationCode 验证码
 *  @param username        账号
 *  @param deviceId        设备识别号
 *  @param deviceType      设备型号
 *  @param osType          操作系统类型
 *  @param osVersion       操作系统版本
 *  @param success         成功回调
 *  @param failure         失败回调
 */
+ (void)loginWithusername:(NSString *)username
          verficationCode:(NSString *)verficationCode
                 password:(NSString *)password
                 deviceId:(NSString *)deviceId
               deviceType:(NSString *)deviceType
                   osType:(NSString *)osType
                osVersion:(NSString *)osVersion
                  success:(void (^)(id responseObject))success
                  failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  修改密码接口
 *
 *  @param userId      用户id
 *  @param oldPassword 旧密码
 *  @param newPassword 新密码
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)modifyPasswordWithUserId:(NSString *)userId
                     oldPassword:(NSString *)oldPassword
                     newPassword:(NSString *)newPassword
                         success:(void (^)(id responseObject))success
                         failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  修改个人资料接口
 *
 *  @param userId   用户id
 *  @param fullName 用户名
 *  @param phoneNum 手机号
 *  @param email    邮箱
 */
+ (void)modifyPersonalWithUserId:(NSString *)userId
                        fullName:(NSString *)fullName
                        phoneNum:(NSString *)phoneNum
                           email:(NSString *)email
                         success:(void (^)(id responseObject))success
                         failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  登出
 *
 *  @param userId  用户id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)logoutWithUserId:(NSString *)userId
                 success:(void (^)(id responseObject))success
                 failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  重设密码接口
 *
 *  @param phoneNum        手机号
 *  @param password        密码
 *  @param email           邮箱（二选一）
 *  @param verficationCode 验证码
 *  @param success         成功回调
 *  @param failure         失败回调
 */
+ (void)resetPasswordWithPhoneNum:(NSString *)phoneNum
                         password:(NSString *)password
                            email:(NSString *)email
                  verficationCode:(NSString *)verficationCode
                          success:(void (^)(id responseObject))success
                          failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  设置个人头像
 *
 *  @param userId    用户id
 *  @param imageData 图片数据
 *  @param success   成功回调
 *  @param failure   失败回调
 */
+ (void)setHeadImageWithUserId:(NSString *)userId
                     imageData:(NSData *)imageData
                       success:(void (^)(id responseObject))success
                       failure:(void (^)(NSError *error))failure;
#pragma mark - GET/user/
/**
 *  @Author
 *
 *  我的抵用劵接口
 *
 *  @param userId      用户id
 *  @param startNumber 开始条数
 *  @param endNumber   结束条数
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)getCouponListWithUserId:(NSString *)userId
                    startNumber:(NSString *)startNumber
                      endNumber:(NSString *)endNumber
                        success:(void (^)(id responseObject))success
                        failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  我的抵用劵明细表接口
 *
 *  @param userId      用户id
 *  @param startNumber 开始条数
 *  @param endNumber   结束条数
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)getCouponUsedListWithUserId:(NSString *)userId
                         startNumber:(NSString *)startNumber
                           endNumber:(NSString *)endNumber
                             success:(void (^)(id responseObject))success
                             failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  我的个人信息接口
 *
 *  @param userId  用户id
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getPersonalWithUserId:(NSString *)userId
                    withToken:(NSString *)token
                      success:(void (^)(id responseObject))success
                      failure:(void (^)(NSError *error))failure;

/**
 *  @Author
 *
 *  获取所有小区下的房源列表
 *
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getAllCommunityLocationListSuccess:(void (^)(id responseObject))success
                                   failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  上传图片的请求
 *
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)uploadPhotoWithImageInfoDic:(NSMutableDictionary *)dic
                              image:(UIImage *)image
                             Success:(void (^)(id responseObject))success
                             failure:(void (^)(NSError *error))failure;
/**
 *  @Author
 *
 *  获取指定小区下的房源列表
 *
 *  @param leaseType 类型：日、月、年
 *  @param estateId  指定小区id
 *  @param success   成功回调
 *  @param failure   失败回调
 *
 */
+ (void)getCommunityLocationDetailListWithEstateId:(NSString *)estateId
                                         leaseType:(NSString *)leaseType
                                           success:(void (^)(id responseObject))success
                                           failure:(void (^)(NSError *error))failure;

/**
 *  获取租约列表
 *
 *  @param userId  用户id
 *  @param startNo 开始条数
 *  @param endNo   结束条数
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getLeaseListWithUserId:(NSString *)userId
                       startNo:(NSString *)startNo
                         endNo:(NSString *)endNo
                       success:(void (^)(id responseObject))success
                       failure:(void (^)(NSError *error))failure;

/**
 *  获取Yopark租约列表
 *
 *  @param userId  用户id
 *  @param startNo 开始条数
 *  @param endNo   结束条数
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getYoparkLeaseListWithUserId:(NSString *)userId
                             startNo:(NSString *)startNo
                               endNo:(NSString *)endNo
                             success:(void (^)(id responseObject))success
                             failure:(void (^)(NSError *error))failure;

/**
 *  获取非Yopark租约列表详情
 *
 *  @param orderId  订单编号
 *  @param success  成功回调
 *  @param failure  失败回调
 */
+ (void)getThirdLeaseListDetailWithOrderId:(NSString *)orderId
                                   success:(void (^)(id responseObject))success
                                   failure:(void (^)(NSError *error))failure;

/**
 *  获取Yopark租约列表详情
 *
 *  @param orderId 订单编号
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getYoparkLeaseListDetailWithOrderId:(NSString *)orderId
                                    success:(void (^)(id responseObject))success
                                    failure:(void (^)(NSError *error))failure;

/**
 *  获取支付订单(Yopark)
 *
 *  @param orderId 订单编号
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getYoparkLeasePayOrderWithOrderId:(NSString *)orderId
                                  success:(void (^)(id responseObject))success
                                  failure:(void (^)(NSError *error))failure;

/**
 *  获取支付订单(非Yopark)
 *
 *  @param orderId 订单编号
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getThirdLeasePayOrderWithOrderId:(NSString *)orderId
                                 success:(void (^)(id responseObject))success
                                 failure:(void (^)(NSError *error))failure;

/**
 *  订单辅助
 *
 *  @param orderNo 订单号
 *  @param token   登录的token
 *  @param success 成功回调
 *  @param failure 失败回调
 */
+ (void)getLeaseAssistPayOrderWithOrderNo:(NSString *)orderNo
                                    token:(NSString *)token
                                  success:(void (^)(id responseObject))success
                                  failure:(void (^)(NSError *error))failure;

#pragma mark - appstore信息
/**
 *  @Author
 *
 *  获取appstore信息
 *
 *  @param estateId  appid
 *  @param success   成功回调
 *  @param failure   失败回调
 */
+ (void)getAppStoreVersionWithAppId:(NSString *)appId
                             sucess:(void (^)(id responseObject))success
                            failure:(void (^)(NSError *error))failure;

@end
